package com.yhsimon.realm.member.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum LevelCodeEnum {

    LIANQIQI(1, "练气期", 1000),
    ZHUJIQI(2, "筑基期", 2500),
    JIEDANQI(3, "结丹期", 4500),
    YUANYINGQI(4, "元婴期", 7500),
    HUASHENQI(5, "结丹期", 12000),

    ;


    private Integer code;
    private String name;
    private Integer threshold;


    public static LevelCodeEnum getLevelInfoByCode(Integer code) {
        return switch (code) {
            case 1 -> LIANQIQI;
            case 2 -> ZHUJIQI;
            case 3 -> JIEDANQI;
            case 4 -> YUANYINGQI;
            case 5 -> HUASHENQI;
            default -> null;
        };
    }
}
